יום שבת, 2 במרץ 2013

02.03.2013

Android

Row , synthetic sensors

SensorManager   class

Sensor class

public boolean isAccelerometerSupported(Context context)
{
SensorManager sm = (SensorManager) context
.getSystemService(Context.SENSOR_SERVICE);
List<Sensor> sensors = sm.getSensorList(Sensor.TYPE_ACCELEROMETER);
return sensors.size() > 0;
}
SensorEvent.timestamp 
Sensor.getMinDelay ()
Sensor.getMaximumRange ()
Sensor.getResulotion ()
SensorEventListener 

Java SE


java 8 lambdas


List<Int>  theList =  Arrays.asList(1,2,3,4,16)
.stream()
.map(s -> "Hello " + s)
.collect(Collectors.toList());





 
 
SoccerService soccerService = (teamA, teamB) -> {
SoccerResult result = null;
if (teamA == teamB) {
result = SoccerResult.DRAW;
}
else if(teamA < teamB) {
result = SoccerResult.LOST;
}
else {
result = SoccerResult.WON;
}

return result;
};


 


Ruby 

sub and gsub (Replace all )
myStr = “test test”
myStr2 = myStr.sub (/te/ , “*”)
puts “#{mystr2}”
 
class Regexp
Regexp.new (“mm/dd”)
%{mm/dd}
=~ positive match 
!~ negative match 
 

Groovy


assert


class Book {



String titie


}


def gb = new Book ()


gb.SetTitle (“Mazal sadon”)


gb.Title = “my life”


Linux


struct cdev *my_cdex = cdev_alloc ();


cdev_add


cdev_del


The user-level library glibc.so has an implementation of the threads.


light-weight processes – representation of the user space thread in kernel space


 Each user-thread has a 1×1 mapping to an LWP


for each process its light weight process share the same group id allowing resource sharing

#include <sched.h>
int clone (int (*fn) (void *), void *child_stack, int flags, void *arg);



 


 

 

 

 

 

 

אין תגובות:

הוסף רשומת תגובה