i " вставить текст до курсора
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
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> | |
<!-- | |
For other language: Instead of `ace/mode/ruby`, Use | |
Markdown -> `ace/mode/markdown` | |
Python -> `ace/mode/python` | |
C/C++ -> `ace/mode/c_cpp` | |
Javscript -> `ace/mode/javascript` | |
Java -> `ace/mode/java` | |
Scala- -> `ace/mode/scala` |
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 com.company; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
public class Main { | |
public static void main(String[] args) { |
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 readDBF(String filename) throws FileNotFoundException, DBFException { | |
Object[] row; | |
Map<String, String> resultMap = new HashMap<>(); | |
//Необходимый минимум для комфортной работы с DBF | |
dbfReader = new DBFReader(new FileInputStream(filename)); | |
Map<String, Integer> fieldList = new HashMap<>(); | |
dbfReader.setCharactersetName("cp866"); | |
//Заполнение карты с полями, чтобы обращаться по имени поля | |
for (Integer i = 0; i < dbfReader.getFieldCount(); i++) { | |
DBFField field = dbfReader.getField(i); |
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
persons.stream() | |
.map(Wrapper::new) | |
.distinct() | |
.map(Wrapper::unwrap) | |
...; | |
The class Wrapper might look as follows: | |
class Wrapper { | |
private final Person person; |
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 com.company; | |
import org.json.JSONObject; | |
import org.json.XML; | |
import java.io.*; | |
import java.nio.charset.Charset; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; |
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
import javafx.application.Application; | |
import javafx.scene.*; | |
import javafx.scene.control.*; | |
import javafx.scene.control.cell.PropertyValueFactory; | |
import javafx.stage.Stage; | |
import javafx.util.Callback; | |
// demonstrates highlighting rows in a tableview based upon the data values in the rows. | |
public class DebtCollectionTable extends Application { | |
public static void main(String[] args) throws Exception { launch(args); } |
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 static String getHtml(String url, String encoding) throws IOException { | |
BufferedReader in = new BufferedReader(new InputStreamReader(new URL(url).openStream())); | |
String s, html = ""; | |
while ((s = in.readLine()) != null){ | |
html+=s; | |
} | |
in.close(); | |
return html; | |
} |
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
class FIOProcessor implements DbfRowProcessor { | |
public List<Human> getHumans() { | |
return humans; | |
} | |
public void setHumans(List<Human> humans) { | |
this.humans = humans; | |
} | |
List<Human> humans = new ArrayList<Human>(); |
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
PrintWriter writer = new PrintWriter("d:/humansFromDbf.csv", "UTF8"); | |
for (Human human: humanList){ | |
writer.print(human+"\n"); | |
} | |
writer.close(); |
NewerOlder