我想用monocross android应用程序开发,但我在某处读到它并不是真正免费的.你可以免费开发单片机的android,或者你需要支付某种类型的扩展(如monodroid).它是如何工作的?
如果它不是免费的,还有其他选择吗?我不介意支付能帮助我更快编码的东西,但肯定不是每年1000美元.
我正在寻找一种从麦克风实时读取音量数据的方法.只是某种一般的"响度".当你在html5画布元素上对着麦克风讲话时,目的是让嘴唇移动......
我基本上想要这个插件但是对于麦克风级别而不是相机:
https://github.com/casoninabox/luminance-cordova-ios
有没有人知道任何现有的库可以做到这一点,或者我如何为iOS创建一个插件?我猜它会涉及到AVAudioSession?
我有一个通用的功能界面:
@FunctionalInterface
public interface Feeder<T extends Animal> {
void feed(T t);
}
Run Code Online (Sandbox Code Playgroud)
还有一些bean为不同的Animal子类实现了这个接口.
@Configuration
public class Config {
@Bean
public Feeder<Dog> dogFeeder() {
return dog -> dogService.feedDog(dog);
}
@Bean
public Feeder<Cat> catFeeder() {
return cat -> catService.feedCat(cat);
}
}
Run Code Online (Sandbox Code Playgroud)
现在已经为这些bean注入了一个服务类,并给出了一个实例Animal.如何确定使用正确的Feeder bean?
@Service
public class PetStore {
@Autowired
private List<Feeder<? extends Animal> feeders;
private void feed(Animal animal) {
//TODO: How to determine the correct feeder from feeders?
Feeder<? extends Animal> correctFeeder = ....
correctFeeder.feed(animal);
}
}
Run Code Online (Sandbox Code Playgroud)
我试过的事情:
我最初认为我可以使用如何获取泛型类型T的类实例, …
我试图实现一种跟踪数据更改并为我的应用程序创建历史日志的方法。因为我正在使用 EclipseLink,所以应该很容易并且可以像他们在 EclipseLink 常见问题解答上写的那样获得更改 第一个解决方案有效,但基于第二个事件的方法无效。每次引发事件时,ObjectChangeSet 为空。
我不是简单地使用 HistoryPolicy 的原因是我不想将有关登录用户(而不是 db 用户)的信息和更改的数据存储到单独的表中。我搜索了很多,但找不到任何解决此问题的方法。
这是我的实体类:
@Entity
@EntityListeners(HistoryEventListener.class)
@Table(name = "t_users")
public class Users implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "GENSEQ_USERS")
@SequenceGenerator(name = "GENSEQ_USERS", sequenceName = "SEQ_USERS", allocationSize = 1, initialValue = 1)
private Integer id;
@Column(nullable = false)
private String userid;
...
}
Run Code Online (Sandbox Code Playgroud)
这是我的 DescriptorEventAdapter 类:
public class HistoryEventListener extends DescriptorEventAdapter {
@Override
public void postUpdate(DescriptorEvent event) {
ObjectChangeSet changeSet = …Run Code Online (Sandbox Code Playgroud) 我有圆圈标记
var myMarker = L.circleMarker(stuSplit,
{ title: 'unselected' })
.bindLabel("Name: " + students[i][j][0]
+ " ReachTime: " + students[i][j][2]);
Run Code Online (Sandbox Code Playgroud)
现在我想找到纬度和经度这个myMarker.
我在尝试,myMarker.getLatLng()但它没有用.
在我们公司,我们拥有非常强大的基于Linux的构建服务器(具有40核的双Xeon)和不那么强大的win7笔记本电脑.我们用C/C++语言构建我们的产品,用于深奥的CPU.编译器仅存在于Linux中.我可以用Qt Creator编辑我的git repo.它工作得很快,一切都很快.但我无法在笔记本电脑上构建源代码.我们有一个主要的git repo,我可以将相同的repo克隆到我的笔记本电脑和构建服务器.当我按下构建按钮时,我希望实现这一点,我的代码在构建服务器上神奇地构建.我做了一个概念证明解决方案,其中我的构建脚本在我的repo上执行git diff并将其scp到构建服务器,而不是ssh构建服务器在服务器repo上应用diff而不是启动并等待编译.但是这个解决方案并不是那么简单.我认为存在更好的接近/方法.那么如何在外部服务器上构建我的git repo?
我第一次使用传单/ JavaScript,我想显示一个地图,GeoJSON图层在每次移动时都会改变......只显示该区域的点.
这是我的代码来源:
// Function to refresh points to display
function actualiseGeoJSON() {
// Default icon for my points
var defaultIcon = L.icon({
iconUrl: '../images/icones/cabane.png',
iconSize: [16, 16],
iconAnchor: [8, 8],
popupAnchor: [0, -8]
});
// We create each point with its style (from GeoJSON file)
function onEachFeature(feature, layer) {
var popupContent = '<a href="' + feature.properties.url + '">' + feature.properties.nom + "</a>";
layer.bindPopup(popupContent);
var cabaneIcon = L.icon({
iconUrl: '../images/icones/' + feature.properties.type + '.png',
iconSize: [16, 16],
iconAnchor: [8, 8], …Run Code Online (Sandbox Code Playgroud) 我目前正在阅读Effective C++.有一个关于使用静态局部变量的部分,它说如果多个线程访问一个静态变量,那么在该变量的初始化期间可能存在竞争条件.
至少这是我的解释.这是真的?例如,在C#中,类静态变量的初始化永远不会有竞争条件.
例如,此代码在静态变量初始化期间是否具有竞争条件?
FileSystem& tfs()
{
static FileSystem fs;
return fs;
}
Run Code Online (Sandbox Code Playgroud)
以下是本书的除外.
这是应用于tfs和tempDir的技术:
Run Code Online (Sandbox Code Playgroud)class FileSystem { ... }; // as before FileSystem& tfs() // this replaces the tfs object; it could static in the FileSystem class { static FileSystem fs; // define and initialize a local static object return fs; // return a reference to it }.
Run Code Online (Sandbox Code Playgroud)class Directory { ... }; // as before Directory::Directory( params ) // as before, except references to tfs are now …
<staging>
<stage>
<name>aaaa</name>
<taskName>aa</taskName>
<taskName>qwqwse</taskName>
<taskName>qwe</taskName>
<iconName>asdad</iconName>
<iconName>dasd</iconName>
</stage>
<stage>
<name>dasda</name>
<taskName>asdak</taskName>
<taskName>dasdk1</taskName>
<taskName>dasdask2</taskName>
<iconName>dasdn</iconName>
<iconName>dasdcon</iconName>
</stage>
</staging>
Run Code Online (Sandbox Code Playgroud)
这是我的java类:
@XStreamAlias("stage")
public class Stage {
private String name;
private List<String> taskName;
private List<String> iconName;
}
Run Code Online (Sandbox Code Playgroud)
我正在使用XStream 1.4.2将该XML数据转换为Java对象.
我见过几个SO帖子,但它仍然没有解决我的问题.
抛出以下异常:
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$DuplicateFieldException: Duplicate field taskName
---- Debugging information ----
field : taskName
class : com.thbs.soaconnect.model.configuration.Stage
required-type : com.thbs.soaconnect.model.configuration.Stage
converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path : /soaConnect/staging/stage/taskName[2]
line number : 28
class[1] : java.util.ArrayList
converter-type[1] : com.thoughtworks.xstream.converters.collections.CollectionConverter
class[2] : com.thbs.soaconnect.model.configuration.Configuration
version : null
Run Code Online (Sandbox Code Playgroud)
我之前尝试过以下方式:
xstream.addImplicitCollection(Stage.class,"taskName", String.class); …Run Code Online (Sandbox Code Playgroud) 我有两种方法:
class C1
{
void m1() {//does sth}
void m2(int x1, int x2) {//does sth}
}
Run Code Online (Sandbox Code Playgroud)
//记录任何方法所用的时间
logMethodExecTime(m1);
logMethodExecTime(m2);
Run Code Online (Sandbox Code Playgroud)
不知道如何使用JDK8功能接口和方法引用来定义方法'logMethodExecTime'的正确语法?
以下不起作用:
class Utils
{
public static void logMethodExecTime(Supplier<Void> s)
{
long start = System.nanoTime();
s.get();
long end = System.nanoTime();
System.out.println(((end-start)/1000000000d) + " secs");
}
}
Run Code Online (Sandbox Code Playgroud)
和调用:
C1 c = new C1();
Utils.logMethodExecTime(c::m1);
//Also how can we have one single definition of 'logMethodExecTime'
//to accept any method with any number of args
Utils.logMethodExecTime(c::m2);
Run Code Online (Sandbox Code Playgroud) java ×3
c++ ×2
javascript ×2
leaflet ×2
ajax ×1
android ×1
audit ×1
c# ×1
changelog ×1
compilation ×1
cordova ×1
eclipselink ×1
geojson ×1
git ×1
history ×1
ios ×1
java-8 ×1
jpa ×1
lambda ×1
markers ×1
microphone ×1
monocross ×1
reflection ×1
singleton ×1
spring ×1
xml ×1
xml-parsing ×1
xstream ×1