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
<?php | |
/* Gets individual core information */ | |
function GetCoreInformation() { | |
$data = file('/proc/stat'); | |
$cores = array(); | |
foreach( $data as $line ) { | |
if( preg_match('/^cpu[0-9]/', $line) ) | |
{ | |
$info = explode(' ', $line ); | |
$cores[] = array( |
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 download(String url) { | |
BufferedReader reader = null; | |
try { | |
HttpClient client = new DefaultHttpClient(); | |
HttpGet get = new HttpGet(url); | |
HttpResponse response = client.execute(get); |
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 fr.umlv.poo.automate0.command; | |
import java.util.Comparator; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Objects; | |
import java.util.concurrent.BlockingDeque; | |
import java.util.concurrent.LinkedBlockingDeque; | |
import java.util.concurrent.PriorityBlockingQueue; |
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 fr.umlv.poo.automate0.command; | |
import fr.umlv.poo.automate0.robot.Robot; | |
import fr.umlv.poo.automate0.robot.axis.AxisType; | |
/** | |
* Example: | |
* CommandFactory.create(robot, CommandFactory.AXIS_MOVE_COMMAND, AxisType.X, 120); | |
* CommandFactory.create(robot, CommandFactory.PLIERS_OPEN_COMMAND); | |
*/ |
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
----- | |
MotionEvent mEvent = context.pollMotion(); | |
if(mEvent != null) { | |
Input event = new Input(mEvent); | |
event(event, lastEvent); | |
lastEvent = event; | |
} |
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 fr.november; | |
public final class Semaphore { | |
private final int capacity; | |
private final Object lock; | |
private volatile int acquired; | |
public Semaphore(int capacity) { | |
this.capacity = capacity; |
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
wlock.lock(); | |
rlock.lock(); | |
try { | |
long cur_time = System.nanoTime(); | |
if (cur_time > (lastUpdate + 1000000000L)) { | |
setVersion(getVersion() + 1); | |
setLastUpdate(cur_time); | |
} |