Skip to content

Instantly share code, notes, and snippets.

View guinetik's full-sized avatar

guinetik guinetik

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
@guinetik
guinetik / job.xml
Created April 5, 2018 17:51
FlatFileItemReader
<bean id="itemReader" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step">
<property name="resource" value="file.csv" />
<property name="lineMapper">
<bean class="org.springframework.batch.item.file.mapping.PassThroughLineMapper" />
</property>
<property name="strict" value="true" />
</bean>
import java.util.ArrayList;
public class HelloWorld{
private int max;
private ArrayList<String> lista;
public static int MAX = 10;
public HelloWorld(int max) throws Exception {
if(max > 0 && max < MAX) {
this.max = max;
@guinetik
guinetik / RecordActivity.java
Created July 21, 2013 21:58
create video file
videoFile = new File(Environment.getExternalStorageDirectory().getPath() + "/Recorder/video.mp4");
if (!videoFile.exists()) {
try {
videoFile.createNewFile();
Log.i(LOG_TAG, "create videoFile success");
} catch (Exception e) {
Log.e(LOG_TAG, "create videoFile failed");
}
} else {
@guinetik
guinetik / RecordActivity.java
Created July 21, 2013 21:54
ffmpeg record audio
while (isAudioRecording) {
bufferReadResult = audioRecord.read(audioData, 0, audioData.length);
if (bufferReadResult == 1024 && isRecorderStart) {
Buffer[] realAudioData1024 = new Buffer[bufferReadResult];
System.arraycopy(audioData, 0, realAudioData1024, 0, bufferReadResult);
recorder.record(yuvIplimage);
recorder.record(realAudioData1024);
Log.d(LOG_TAG, "recorder.record(): bufferReadResult == 1024");